package myContacts;

import java.io.Serializable;

public class StructuredPostalAddress implements Serializable, Cloneable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String label;
	private String mailClass;
	private boolean primary;
	private String rel;
	private String usage;
	
	private Agent agent;
	private City city;
	private Country country;
	private FormattedAddress formattedAddress;
	private Housename housename;
	private Neighborhood neighborhood;
	private PoBox pobox;
	private PostCode postcode;
	private Region region;
	private Street street;
	private Subregion subregion;

	public StructuredPostalAddress() {
		super();
		
		label = "";
		mailClass = "";
		primary = false;
		rel = "";
		usage = "";
		
		agent = new Agent();
		city = new City();
		country = new Country();
		formattedAddress = new FormattedAddress();
		housename = new Housename();
		neighborhood = new Neighborhood();
		pobox = new PoBox();
		postcode = new PostCode();
		region = new Region();
		street = new Street();
		subregion = new Subregion();
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getMailClass() {
		return mailClass;
	}

	public void setMailClass(String mailClass) {
		this.mailClass = mailClass;
	}

	public boolean isPrimary() {
		return primary;
	}

	public void setPrimary(boolean primary) {
		this.primary = primary;
	}

	public String getRel() {
		return rel;
	}

	public void setRel(String rel) {
		this.rel = rel;
	}

	public String getUsage() {
		return usage;
	}

	public void setUsage(String usage) {
		this.usage = usage;
	}

	public Agent getAgent() {
		return agent;
	}

	public void setAgent(Agent agent) {
		this.agent = agent;
	}

	public City getCity() {
		return city;
	}

	public void setCity(City city) {
		this.city = city;
	}

	public Country getCountry() {
		return country;
	}

	public void setCountry(Country country) {
		this.country = country;
	}

	public FormattedAddress getFormattedAddress() {
		return formattedAddress;
	}

	public void setFormattedAddress(FormattedAddress formattedAddress) {
		this.formattedAddress = formattedAddress;
	}

	public Housename getHousename() {
		return housename;
	}

	public void setHousename(Housename housename) {
		this.housename = housename;
	}

	public Neighborhood getNeighborhood() {
		return neighborhood;
	}

	public void setNeighborhood(Neighborhood neighborhood) {
		this.neighborhood = neighborhood;
	}

	public PoBox getPobox() {
		return pobox;
	}

	public void setPobox(PoBox pobox) {
		this.pobox = pobox;
	}

	public PostCode getPostcode() {
		return postcode;
	}

	public void setPostcode(PostCode postcode) {
		this.postcode = postcode;
	}

	public Region getRegion() {
		return region;
	}

	public void setRegion(Region region) {
		this.region = region;
	}

	public Street getStreet() {
		return street;
	}

	public void setStreet(Street street) {
		this.street = street;
	}

	public Subregion getSubregion() {
		return subregion;
	}

	public void setSubregion(Subregion subregion) {
		this.subregion = subregion;
	}

	@Override
	protected StructuredPostalAddress clone() {
		// TODO Auto-generated method stub
		StructuredPostalAddress structuredPostalAddress = new StructuredPostalAddress();
		
		structuredPostalAddress.label =label;
		structuredPostalAddress.mailClass = mailClass;
		structuredPostalAddress.primary = primary;
		structuredPostalAddress.rel = rel;
		structuredPostalAddress.usage = usage;
		
		structuredPostalAddress.agent = (agent!=null) ? agent.clone() : null;
		structuredPostalAddress.city = (city!=null) ? city.clone() : null;
		structuredPostalAddress.country = (country!=null) ? country.clone() : null;
		structuredPostalAddress.formattedAddress = (formattedAddress!=null) ? formattedAddress.clone() : null;
		structuredPostalAddress.housename = (housename!=null) ? housename.clone() : null;
		structuredPostalAddress.neighborhood = (neighborhood!=null) ? neighborhood.clone() : null;
		structuredPostalAddress.pobox = (pobox!=null) ? pobox.clone() : null;
		structuredPostalAddress.postcode = (postcode!=null) ? postcode.clone() : null;
		structuredPostalAddress.region = (region!=null) ? region.clone() : null;
		structuredPostalAddress.street = (street!=null) ? street.clone() : null;
		structuredPostalAddress.subregion = (subregion!=null) ? subregion.clone() : null;
		
		return structuredPostalAddress;
	}

}
